<html>
    <head>
		<script runat='server'> // DO NOT REMOVE: needed for the Jaxer unit testing harness 
			Jaxer.load(Jaxer.request.parsedUrl.queryParts.testHarnessHeader);
		</script>	
        <script type="text/javascript" runat="server">
      		function test_SerializeData_EmptyArray()
            {
                var data = [];
                var expected = "[]";
                var result = Jaxer.Serialization.toJSONString(data, {as: Jaxer.Serialization.JAXER_METHOD});
                
                assertEquals(result, expected);
            }
            
            function test_SerializeData_ArrayOfBooleans()
            {
                var data = [true, false, false, true];
                var expected = "[true,false,false,true]";
                var result = Jaxer.Serialization.toJSONString(data, {as: Jaxer.Serialization.JAXER_METHOD});
                
                assertEquals(result, expected);
            }
            
            function test_SerializeData_ArrayOfNumbers()
            {
                var data = [1, 2.1, .3, 1e-12];
                var expected = "[1,2.1,0.3,1e-12]";
                var result = Jaxer.Serialization.toJSONString(data, {as: Jaxer.Serialization.JAXER_METHOD});
                
                assertEquals(result, expected);
            }
            
            function test_SerializeData_ArrayOfStrings()
            {
                var data = ["", "abc", "def"];
                var expected = "[\"\",\"abc\",\"def\"]";
                var result = Jaxer.Serialization.toJSONString(data, {as: Jaxer.Serialization.JAXER_METHOD});
                
                assertEquals(result, expected);
            }
            
            function test_SerializeData_ArrayOfArrays()
            {
                var data = [[], [true, false, false, true], [1, 2.1, .3, 1e-12], ["", "abc", "def"]];
                var expected = "[[],[true,false,false,true],[1,2.1,0.3,1e-12],[\"\",\"abc\",\"def\"]]";
                var result = Jaxer.Serialization.toJSONString(data, {as: Jaxer.Serialization.JAXER_METHOD});
                
                assertEquals(result, expected);
            }
			
			function test_DeserializeData_EmptyArray()
			{
				var json = "[]";
				var expected = [];
				var result = Jaxer.Serialization.fromJSONString(json, {as: Jaxer.Serialization.JAXER_METHOD});
				
				assertEquals(result.toString(), expected.toString());
			}
			
			function test_DeserializeData_ArrayOfBooleans()
			{
				var json = "[true,false,false,true]";
				var expected = [true, false, false, true];
				var result = Jaxer.Serialization.fromJSONString(json, {as: Jaxer.Serialization.JAXER_METHOD});
				
				assertEquals(result.toString(), expected.toString());
			}
			
			function test_DeserializeData_ArrayOfNumbers()
			{
				var json = "[1,2.1,0.3,1e-12]";
				var expected = [1, 2.1, .3, 1e-12];
				var result = Jaxer.Serialization.fromJSONString(json, {as: Jaxer.Serialization.JAXER_METHOD});
				
				assertEquals(result.toString(), expected.toString());
			}
			
			function test_DeserializeData_ArrayOfStrings()
			{
				var json = "[\"\",\"abc\",\"def\"]";
				var expected = ["", "abc", "def"];
				var result = Jaxer.Serialization.fromJSONString(json, {as: Jaxer.Serialization.JAXER_METHOD});
				
				assertEquals(result.toString(), expected.toString());
			}
			
			function test_DeserializeData_ArrayOfArrays()
			{
				var json = "[[],[true,false,false,true],[1,2.1,0.3,1e-12],[\"\",\"abc\",\"def\"]]";
				var expected = [
					[],
					[true, false, false, true],
					[1, 2.1, .3, 1e-12],
					["", "abc", "def"]
				];
				var result = Jaxer.Serialization.fromJSONString(json, {as: Jaxer.Serialization.JAXER_METHOD});
				
				assertEquals(result.toString(), expected.toString());
			}
        </script>
    </head>
    <body>
    </body>
</html>